<include file="Public/common" />
<block name="content">
    <style>
        th,td{text-align: center;}
        .row-2{
            padding: 5px 10px;

        }

        .row-input-width{
            /*width: 347px!important;*/
        }


        .pull-right{
            margin-right: 14px!important;
        }
        .orderNo-item{
            /*padding-left: 28px;*/
        }
        .bill-time-item{
            padding-left: 14px;
        }
        .range-item{
            padding: 7px 10px;
            background-color: #eee;
        }

        .input-left{
            margin-left: -4px;
        }
        .table-scroll{
            /*display: inline-block;*/
            /*width: 1200px!important;*/
            /*overflow: scroll;*/
            /*table-layout: fixed;*/
        }
        .total-item{
            text-align: right;
            padding: 0 3px 10px 3px;
            color: red;
        }
        .tab-content{ position: static; }
    </style>
    <div class="page-header"><h1><i class="fa fa-home"></i> 首页 &gt; 财务管理 &gt; 分销商结算列表</h1></div>

    <div class="col-xs-12">

        <div class="tab-content">
            <div class="row" >
                <form action="" id="form" class="form-inline " method="" style="margin-left:10px;" >
                    <input type="hidden" name="p" value="1"/>
                    <div class="row-2" >
                        <div class="form-group form-group-2">
                            <label for="" class="bill-time-item">选择日期:</label>
                            <input type="text" name="start_time" id="start" value="<if condition="$_GET['start_time']">{$_GET['start_time']}</if>">
                            <span class="range-item input-left">至</span>
                            <input class="input-left" type="text" name="end_time" id="end" value="<if condition="$_GET['end_time']">{$_GET['end_time']}</if>">
                        </div>
                    </div>
                    <div class="row-2" >
                        <div class="form-group">
                            <label for="group_num" class="orderNo-item"></label>
                            <input type="text" class="row-input-width" name="group_num" id="group_num" value="<if condition="$_GET['group_num']">{$_GET['group_num']}</if>" placeholder="请输入团号">
                        </div>
                        <div class="form-group">
                            <label for="reseller_sn" class="orderNo-item"></label>
                            <input type="text" class="row-input-width" name="reseller_sn" id="reseller_sn" value="<if condition="$_GET['reseller_sn']">{$_GET['reseller_sn']}</if>" placeholder="请输入分销商编号">
                        </div>
                        <div class="form-group">
                            <label for="order_num" class="orderNo-item"></label>
                            <input type="text" class="row-input-width" name="reseller_name" id="reseller_name" value="<if condition="$_GET['reseller_name']">{$_GET['reseller_name']}</if>" placeholder="请输入分销商名称">
                        </div>
                    </div>
                    <div class="col-xs-12 " style="padding:15px">
                        <button type="button" onclick="outExcel()" class="btn btn-primary">导出</button>
                        <button type="submit" class="btn btn-primary submit-btn">查询</button>
                        <div class="dropdown" style="display: inline-block">
                            <button type="button" class="btn btn-primary dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">筛选<span class="caret"></span></button>
                            <ul id="menuList" class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1" style="padding:10px;"></ul>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <div class="tabbable">
  <!--           <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab">
                <li class="active"><a href="{:U('Rule/admin_user_list')}">员工列表</a></li>
                <li><a href="{:U('Rule/add_admin')}">添加员工</a></li>
            </ul> -->

            <div class="tab-content">
                <div class="total-item">总结算金额统计：¥{$all_total_end_need_pay}</div>
                <table id="table" class="table table-striped table-bordered table-hover table-condensed text-center table-scroll">
                    <thead>
                        <tr>
                            <th class="filtrate_0" rowspan="2">分销商</th>
                            <th class="filtrate_1" rowspan="2">分销商编号</th>
                            <th class="filtrate_2" rowspan="2">线路编号</th>
                            <th class="filtrate_3" rowspan="2">团号</th>
                            <th class="filtrate_4" rowspan="2">线路名称</th>
                            <th class="filtrate_5" rowspan="2">供应商</th>
                            <!-- <th class="filtrate_6" rowspan="2">订单总数</th> -->
                            <th class="filtrate_6" colspan="2">实际收客人数</th>
                            <!-- <th class="filtrate_8" colspan="3">结算金额(单价)</th> -->
                            <!-- <th class="filtrate_9" rowspan="2">其他费用</th> -->
                            <th class="filtrate_7" rowspan="2">总结算金额</th>
                            <th class="filtrate_8" rowspan="2">操作人</th>
                            <!-- <th width="100" class="filtrate_11" rowspan="2">结算时间</th> -->
                            <!-- <th rowspan="2">操作人</th> -->
                        </tr>
                        <tr>
                            <th class="filtrate_6">成人</th>
                            <th class="filtrate_6">儿童</th>
                           <!-- <th class="filtrate_7">老人</th>-->
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="list" id="v" key="i">
                            <tr >
                                <td class="filtrate_0">{$v.reseller_name}</td>
                                <td class="filtrate_1">{$v.reseller_sn}</td>
                                <td class="filtrate_2">{$v.line_sn}</td>
                                <td class="filtrate_3">{$v.group_num}</td>
                                <td class="filtrate_4">{$v.line_name}</td>
                                <td class="filtrate_5">{$v.supplier_name}</td>
                                <!-- <td class="filtrate_6">{//$v.total_order_num}</td> -->
                                <td class="filtrate_6">{$v.adult_num}</td>
                                <td class="filtrate_6">{$v.child_num}</td>
                                <!--<td class="filtrate_7">{$v.oldMan_num}</td>-->
                                <td class="filtrate_7">{$v.total_money}</td>
                                <td class="filtrate_8">{$v.sales}</td>
                                <!-- <td class="filtrate_11">结算时间xxxxxxxxx</td> -->
                                <!-- <td class="filtrate_12">操作人</td> -->
                            </tr>
                        </volist>
                        <tr>
                            <td colspan="17">
                                <!--分页样式-->
                                <ul class="pagination">
                                    {$show}
                                </ul>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</block>
<block name="js">
<script src="__JS__/jedate/jedate.js"></script>
<script type="text/javascript">
    //导出excel
    function outExcel(){
        $form = $('#form');
        $form.attr('action', '{:U('outResellerSettlementListExportExcel')}');
        $form.submit();
        $form.attr('action', '');
    }

    //生成筛选菜单
    (function(){
        var str = '';
        $('#table').find('tr').eq(0).find('th').each(function(i, n){
            str += '<li><input type="checkbox" class="filtrate" checked="" value="'+i+'" id="filtrate_'+i+'"><label for="filtrate_'+i+'">'+$(n).html()+'</label></li>';
        })
        $('#menuList').append(str);
    }())

    $('#menuList').on('change', '.filtrate', function(){
        var index = parseInt($(this).val());
        if($(this).prop('checked')){
            $('.filtrate_'+index).show();
        }else{
            $('.filtrate_'+index).hide();
        }
    })
     /**
     * 绑定日期选择器
     * @param  {[obj]}    obj        [元素]
     * @param  {[string]} dateFormat [时间格式]
     */
    function dateFormat(obj, dateFormat){
        jeDate({
            dateCell: '#'+$(obj).attr('id'),
            format: dateFormat,
            isinitVal:false,
            isTime:true, //isClear:false,
            okfun:function(val){
            }
        });
    }
   dateFormat($('#start'), 'YYYY-MM-DD');
   dateFormat($('#end'), 'YYYY-MM-DD');
</script>
</block>
